package com.sybil.ot.dominio;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

@Embeddable
public class DefectoParoPK implements Serializable {

   private String serieOT;
   private int numeroOT;
   private int numeroDefecto;

   public DefectoParoPK() {
   }

   public DefectoParoPK(String serieOT, int numeroOT, int numeroDefecto) {
      this.serieOT = serieOT;
      this.numeroOT = numeroOT;
      this.numeroDefecto = numeroDefecto;
   }

   @Basic(optional = false)
   @Column(name = "DPOT_ORTR_SERIE")
   public String getSerieOT() {
      return serieOT;
   }

   public void setSerieOT(String serieOT) {
      this.serieOT = serieOT;
   }

   @Basic(optional = false)
   @Column(name = "DPOT_ORTR_NUMERO")
   public int getNumeroOT() {
      return numeroOT;
   }

   public void setNumeroOT(int numeroOT) {
      this.numeroOT = numeroOT;
   }

   @Basic(optional = false)
   @Column(name = "DPOT_NUMERO")
   public int getNumeroDefecto() {
      return numeroDefecto;
   }

   public void setNumeroDefecto(int numeroDefecto) {
      this.numeroDefecto = numeroDefecto;
   }

   @Override
   public int hashCode() {
      int hash = 0;
      hash += (serieOT != null ? serieOT.hashCode() : 0);
      hash += (int) numeroOT;
      hash += (int) numeroDefecto;
      return hash;
   }

   @Override
   public boolean equals(Object object) {
      if (!(object instanceof DefectoParoPK)) {
         return false;
      }
      DefectoParoPK other = (DefectoParoPK) object;
      if ((this.serieOT == null && other.serieOT != null) || (this.serieOT != null && !this.serieOT.equals(other.serieOT))) {
         return false;
      }
      if (this.numeroOT != other.numeroOT) {
         return false;
      }
      if (this.numeroDefecto != other.numeroDefecto) {
         return false;
      }
      return true;
   }

   @Override
   public String toString() {
      return "DefectoParoPK[ serieOT=" + serieOT + ", numeroOT=" + numeroOT 
              + ", numeroDefecto=" + numeroDefecto + " ]";
   }
}
